function generateUUID() {
    const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
    const uuidChars = [];
    // UUID格式中的固定位置字符
    uuidChars[8] = uuidChars[13] = uuidChars[18] = uuidChars[23] = '-';
    uuidChars[14] = '4';
    for (let i = 0; i < 36; i++) {
        if (!uuidChars[i]) {
            let tmp = 0x0 | Math.random() * 0x10;
            let randomCharIndex = i === 19 ? (tmp & 0x3) | 0x8 : tmp & 0xf;
            uuidChars[i] = chars[randomCharIndex];
        }
    }
    return uuidChars.join('');
}
function newMd5(str) {
    return CryptoJS.MD5(str).toString()
}

function AES_CBC_DE_N(data, key) {
    // var iil1l1 = '4|6|5|3|1|2|7|0'['split']('|')
    //   , lllli = 0x0;
    var data = CryptoJS['enc']['Base64']['stringify'](CryptoJS['enc']['Hex']['parse'](data));
    var keyString = key['substring'](0x0, 0x10);
    var ivString = key['substring'](0x10, 0x20);
    var key = CryptoJS['enc']['Latin1']['parse'](keyString);
    var iv = CryptoJS['enc']['Latin1']['parse'](ivString);
    var decryptData = CryptoJS['AES']['decrypt'](data, key, {
        'iv': iv,
        'mode': CryptoJS['mode']['CBC'],
        'padding': CryptoJS['pad']['Pkcs7']
    });
    return CryptoJS['enc']['Utf8']['stringify'](decryptData);

    // while (!![]) {
    //     switch (iil1l1[lllli++]) {
    //     case '0':
    //         return CryptoJS['enc']['Utf8']['stringify'](I1lIiI);
    //     case '1':
    //         var key = CryptoJS['enc']['Latin1']['parse'](key);
    //         continue;
    //     case '2':
    //         var iv = CryptoJS['enc']['Latin1']['parse'](iv);
    //         continue;
    //     case '3':
    //         iv = i11ili['substring'](0x10, 0x20);
    //         continue;
    //     case '4':
    //         var lllill = CryptoJS['enc']['Hex']['parse'](lllll);
    //         continue;
    //     case '5':
    //         key = i11ili['substring'](0x0, 0x10);
    //         continue;
    //     case '6':
    //         var ill11l = CryptoJS['enc']['Base64']['stringify'](lllill);
    //         continue;
    //     case '7':
    //         var I1lIiI = CryptoJS['AES']['decrypt'](ill11l, key, {
    //             'iv': iv,
    //             'mode': CryptoJS['mode']['CBC'],
    //             'padding': CryptoJS['pad']['Pkcs7']
    //         });
    //         continue;
    //     }
    //     break;
    // }
}

function hxm_decrypt(data) {
    data = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Hex.parse(data));
    let key = CryptoJS.enc.Base64.parse("bmkgcG8gamllIG5pICoqIA==");
    var decryptData = CryptoJS.AES.decrypt(data, key, {
        'iv': key,
        'mode': CryptoJS.mode.CBC,
        'padding': CryptoJS.pad.Pkcs7
    });
    return CryptoJS.enc.Utf8.stringify(decryptData);
}

function hxm_encrypt(data) {
    let key = CryptoJS.enc.Base64.parse("bmkgcG8gamllIG5pICoqIA==");
    var decryptData = CryptoJS.AES.encrypt(data, key, {
        'iv': key,
        'mode': CryptoJS.mode.CBC,
        'padding': CryptoJS.pad.Pkcs7
    });
    return decryptData.ciphertext.toString(CryptoJS.enc.Hex);
}